<template>
  <router-view v-slot="{ Component }">
    <!--  可以做一个ifelse   把需要缓存的和不需要缓存的 分开 -->
    <component :is="Component" v-if="!route.meta.cache" />

    <keep-alive>
      <component :is="Component" v-if="route.meta.cache" />
    </keep-alive>
  </router-view>
</template>

<script setup>
import { ref, watch } from "vue";
import { useRoute } from "vue-router";

const active = ref(0);
let route = useRoute();
console.log(route);
// let taberShow = ref(false);
// let taberPages = ["/", "/sort", "/shopping", "/my"];
// watch(
//   route,
//   (n) => {
//     let path = n.path;
//     taberShow.value = taberPages.includes(path);
//   },
//   {
//     immediate: true,
//   }
// );
</script>

<style></style>
